package com.example.gmr.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;

import com.example.gmr.Adapter.MypageAdapter;
import com.example.gmr.R;

import java.util.ArrayList;

public class Information extends AppCompatActivity {

    private ViewPager viewPager;
    private ArrayList<View> arrayList;
    private MypageAdapter mypageAdapter;
    private Button finish;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.information);

        viewPager=(ViewPager) findViewById(R.id.viewPager);

        arrayList=new ArrayList<View>();
        LayoutInflater li=getLayoutInflater();
        //插入轮播图片
        arrayList.add(li.inflate(R.layout.view_one,null,false));
        arrayList.add(li.inflate(R.layout.view_two,null,false));
        arrayList.add(li.inflate(R.layout.view_three,null,false));
        mypageAdapter=new MypageAdapter(arrayList);
        viewPager.setAdapter(mypageAdapter);

        finish=(Button)findViewById(R.id.finish);
        finish.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(Information.this,Login.class);
                startActivity(intent);
                Toast.makeText(Information.this,"评星成功",Toast.LENGTH_SHORT).show();
            }
        });

    }
}
